import dayjs from "dayjs"


/**
 * @description 根据传入的menuType决定使用哪个表格columns
 */
const getColumns = ({ menuCode, onPreview = Function, onEdit = Function, onDelete = Function, buttonList = Array, tableCloumns }) => {
    // 文章的columns
    const articleColumns = [
        {
            title: "下拉ID",
            key: "optionsId",
            dataIndex: "optionsId",
            width: 120,
        },
    ]

    const screenType2Columns = [
        {
            title: "经销店名称",
            key: "codeValue",
            dataIndex: "codeValue",
            width: 120,
        },
        {
            title: "经销店代码",
            key: "codeNo",
            dataIndex: "codeNo",
            width: 120,
        },
    ]
    const carDealerPolicyColumns = [
        {
            title: "保单号",
            key: "policyNo",
            dataIndex: "policyNo",
            width: 180
        },
        {
            title: "起保日期",
            key: "startTate",
            dataIndex: "startTate",
            width: 120,
            render: (text, record) => dayjs(text).format("YYYY-MM-DD")
        },
        {
            title: "是否车商渠道",
            key: "busiChannel",
            dataIndex: "busiChannel",
        },
        {
            title: "是否分入业务",
            key: "reinsFlag",
            dataIndex: "reinsFlag",

        },
        {
            title: "是否停驶",
            key: "stopDriveFlag",
            dataIndex: "stopDriveFlag",
        },
        {
            title: "续保标识",
            key: "renewalFlag",
            dataIndex: "renewalFlag",
        },
        {
            title: "上年续保标识",
            key: "lastRenewalFlag",
            dataIndex: "lastRenewalFlag",
        },
        {
            title: "签单保费",
            key: "sumpremium",
            dataIndex: "sumpremium",
        },
        {
            title: "自主定价系数",
            key: "priceRate",
            dataIndex: "priceRate",
        },
        {
            title: "手续费（含税）",
            key: "disfeeChgCny",
            dataIndex: "disfeeChgCny",
        },
        {
            title: "是否续保成功标识",
            key: "successRenewalFlag",
            dataIndex: "successRenewalFlag",
        }
    ]
    const carDealerClmColumns = [
        {
            title: "报案号",
            key: "registNo",
            dataIndex: "registNo",
            width: 180
        },
        {
            title: "保单号",
            key: "policyNo",
            dataIndex: "policyNo",
            width: 180
        },
        {
            title: "是否有效立案",
            key: "claimFlag",
            dataIndex: "claimFlag",
        },
        {
            title: "标的车损险赔款",
            key: "carPaid",
            dataIndex: "carPaid",
        },
        {
            title: "三者车损赔款",
            key: "szcsPaid",
            dataIndex: "szcsPaid",

        },
        {
            title: "三者物损赔款",
            key: "szwsPaid",
            dataIndex: "szwsPaid",
        },
        {
            title: "三者人伤赔款",
            key: "szrsPaid",
            dataIndex: "szrsPaid",
        },
        {
            title: "其他赔款",
            key: "otherPaid",
            dataIndex: "otherPaid",
        },
        {
            title: "标的车损核损金额",
            key: "carLossHsPaid",
            dataIndex: "carLossHsPaid",
        },
        {
            title: "标的车损返修金额",
            key: "carLossFxPaid",
            dataIndex: "carLossFxPaid",
        },
        {
            title: "返修工时金额",
            key: "fxGspaid",
            dataIndex: "fxGspaid",
        },
        {
            title: "返修配件金额",
            key: "fxPjpaid",
            dataIndex: "fxPjpaid",
        },
        {
            title: " 推修工时金额",
            key: "txGspaid",
            dataIndex: "txGspaid",
        },
        {
            title: "推修配件金额",
            key: "txPjpaid",
            dataIndex: "txPjpaid",
        }
    ]


    //加载列表结果
    switch (menuCode) {
        case "carDealerPolicy": return carDealerPolicyColumns;
        case "carDealerClm": return carDealerClmColumns;
        case "screenType2": return screenType2Columns;
        default: return articleColumns;
    }

}

export default getColumns;